Skip to content

Commit 2d94f5d

Browse files
committed
Merge #261: Removed MAX_MONEY
33d4b17 deleted MAX_MONEY (Artem Chystiakov) Pull request description: Removed `MAX_MONEY` restriction as it is only useful for Bitcoin. As discussed with Andrew, `rest-elements` should be chain-agnostic, so no need for this check to exist. I believe this restriction may also be relaxed in the `elements` repository for alternative assets. By doing so, it would allow more useful information to be stored on-chain (up to 12 more bits per UTXO!). ACKs for top commit: apoelstra: ACK 33d4b17; successfully ran local tests Tree-SHA512: df1522cd576c22bcde0721bda2666917871891e1a488addd5a256b78fe020a116082ec7cbe9eea7ba76f3938944413ff7545835f64771cd3ed56d5333e6c12d7
2 parents 646f317 + 33d4b17 commit 2d94f5d

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

src/blind.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ pub enum TxOutError {
3939
UnExpectedNullValue,
4040
/// Unexpected Null asset
4141
UnExpectedNullAsset,
42-
/// Money should be between 0 and `21_000_000`
43-
MoneyOutofRange,
4442
/// Zero value explicit txout with non-provably unspendable script
4543
NonUnspendableZeroValue,
4644
/// Zero value pedersen commitment with provably unspendable script
@@ -56,11 +54,6 @@ impl fmt::Display for TxOutError {
5654
match self {
5755
TxOutError::UnExpectedNullValue => write!(f, "UnExpected Null Value"),
5856
TxOutError::UnExpectedNullAsset => write!(f, "UnExpected Null Asset"),
59-
TxOutError::MoneyOutofRange => write!(
60-
f,
61-
"Explicit amount must be\
62-
less than 21 million"
63-
),
6457
TxOutError::NonUnspendableZeroValue => {
6558
write!(
6659
f,
@@ -467,8 +460,6 @@ impl TxOut {
467460
pub const RANGEPROOF_EXP_SHIFT: i32 = 0;
468461
/// Rangeproof Minimum private bits
469462
pub const RANGEPROOF_MIN_PRIV_BITS: u8 = 52;
470-
/// Maximum explicit amount in a bitcoin `TxOut`
471-
pub const MAX_MONEY: u64 = 21_000_000 * 100_000_000;
472463

473464
/// Creates a new confidential output that is **not** the last one in the transaction.
474465
/// Provide input secret information by creating [`SurjectionInput`] for each input.
@@ -631,9 +622,6 @@ impl TxOut {
631622
match self.value {
632623
Value::Null => Err(TxOutError::UnExpectedNullValue),
633624
Value::Explicit(value) => {
634-
if value > Self::MAX_MONEY {
635-
return Err(TxOutError::MoneyOutofRange);
636-
}
637625
if value == 0 {
638626
// zero values are only allowed if they are provably
639627
// unspendable.

0 commit comments

Comments
 (0)