🟠Technical documentation
Tribe harnesses the transformative capabilities of Bitpacs, integrating the cutting-edge Taproot Bitcoin Upgrade (BIP-0341). By leveraging a curated list of public keys, we construct wallets that adhere to a predetermined threshold of user selection. In the wallet generation process, we rely upon the secure functionality provided by the (scure)[https://github.com/paulmillr/scure-base] library. This toolkit ensures the robustness and integrity of our wallet construction, and facilitates seamless integration with the Bitpac framework. Tribe's implementation of Bitpacs and Taproot offers users the most secure, efficient, and user friendly multi-sig experience.
We've outlined how to create and recover bitpacs in our Tribe Core Repository
To create a Bitpac for example you just need to be able to create a multisig taproot wallet.
export const generateMultisigAddress = async (
threshold: number,
pubkeys: string[],
network: 'Testnet' | 'Mainnet',
) => {
const sm = await signerModule;
const p2trMs = sm.p2tr_ms(
threshold,
pubkeys.map((p) => hex.decode(p)).map(toXOnly),
);
const p2tr = sm.p2tr(
undefined,
{ script: p2trMs.script },
network === 'Testnet' ? TESTNET_CONFIG : MAINNET_CONFIG,
true,
);
if (!p2tr.address) {
throw new Error('Could not create address');
}
return { p2trMs: p2tr, threshold };
};
In our Bitpac generation process, we distinguish between two fundamental bitpac types: Non-Crowdfunded Bitpacs and Crowdfunded Bitpacs.
Non-Crowdfunded Bitpacs:
In this bitpac type, membership does not necessitate any upfront financial contribution from members. Upon the creation of a Non-Crowdfunded Bitpac, a unique random key is generated and associated with said bitpac. This key serves the sole purpose of ensuring each Bitpac possesses a distinct wallet address. Importantly, the private key corresponding to this Bitpac is promptly and irreversibly destroyed, ensuring Tribe holds no stake or involvement in the Bitpac's future transactions.
Note: The generation of a random public key for each Bitpac ensures address uniqueness and does not confer any participatory rights. Following creation, the associated private key is securely destroyed and remains unrecorded.
Crowdfunded Bitpacs:
In this bitpac type, membership to the bitpac is allowed exclusively upon the payment of a stipulated fee. To facilitate this, we deploy a two-tiered Bitpac creation system:
Initial Bitpac: This initial structure consists of only two members—the Bitpac creator and a securely generated private key from Tribe. This key is intricately linked to the Bitpac, ensuring that neither the owner nor our entity can access the funds unilaterally. It functions as a 2:2 threshold wallet, meaning that any transaction requires the joint authorization of both parties. This time period is used to allow the creator a window to invite their desired bitpac members to join.
Finalized Bitpac: Once all prospective members have successfully completed the requisite fee payments and approval process, a new Bitpac is generated. This Bitpac aggregates the public keys of approved members. Subsequently, a transaction, pre-authorized and awaiting the creators signature, is automatically generated from our end. This transaction is designed to transfer the funds to the newly formed Bitpac, effectively securing the assets in a collectively controlled environment.
In the event that the creator fails to finalize the bitpac, the funds remain securely held until the bitpac is finalized. There is no other transaction that can be made during the Initial Bitpac phase so the creator doesn't have any incentive not to finalize.
Last updated